Added public property to allow a CCSprite subclass to forcefully disable debug drawing. #234
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using Cocos2D as an external static library, the macro used to influence certain Cocos2D features, such as Debug drawing for CCSprites, are fixed when the library is compiled.
A workaround might be to compile the library in Release and Debug versions with the DEBUG flag directing, for example, when the debug drawing macro's allow the debug shapes to be rendered.
The problem is that this might cause cases in which the debug drawing feature for CCSprite objects is not really usable: if you have a few sprites moving in front of a large background (with the background being essentially just a large CCSprite object in some instancea), all the user will see is a huge white shape and will not be able to discern the small sprites in the foreground.
If we allow the CCSprite to override the debug drawing macro at runtime, we do not either lose performance in release mode and we make debug mode more flexible preventing the case mentioned above.